import { ProjectConfig } from './project';

/**
 * Menu related types
 */

export interface MenuItem {
  id: string;
  title: string;
  icon: string;
  path: string;
  children?: MenuItem[];
  level: number;
  parent?: string;
  [key: string]: any; // Allow additional properties
}

export interface MenuData {
  id: string;
  name: string;
  items: MenuItem[];
  createdAt: string;
  updatedAt: string;
}

export interface MenuPreviewState {
  menuData: MenuData | null;
  previewMode: 'interactive' | 'tree' | 'json';
  selectedMenuItem: MenuItem | null;
  editMode: boolean;
  isLoading: boolean;
  error: string | null;
}

export interface MenuGenerationParams {
  projectId: string;
  config?: Partial<ProjectConfig>;
  fileData?: {
    packageJson?: any;
    routerConfig?: any;
  };
}

export interface MenuNode extends MenuItem {
  key: string;
  title: string;
  children?: MenuNode[];
}